﻿using Microsoft.International.Converters.PinYinConverter;
using System.Text;

namespace CommonUtils
{
    public class PinYinUtil
    {
        public static string get(string text)
        {
            var result = new StringBuilder();
            foreach (char ch in text)
            {
                try
                {
                    result.Append(new ChineseChar(ch).Pinyins[0].ToLower());
                }
                catch
                {
                    result.Append(ch);
                }
            }
            return result.ToString();
        }
    }
}
